Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Scala 2.13 support #823

Closed
wants to merge 5 commits into from
Closed

Add Scala 2.13 support #823

wants to merge 5 commits into from

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Nov 8, 2021

Most of changes are caused by the following two breaking changes in Scala.

  • scala.Seq[+A] is now an alias for scala.collection.immutable.Seq[A] (instead of scala.collection.Seq[A]). Note that this also changes the type of Scala varargs methods.
  • mapValues and filterKeys now return a MapView instead of a Map.

The fix is just adding toSeq and toMap.

See https://docs.scala-lang.org/overviews/core/collections-migration-213.html for more details.

def withClose[B](f: Iterator[A] => Iterator[B]): ClosableIterator[B] = new ClosableIterator[B] {
private val iter =
try {
f(iterator)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is because scala/scala-collection-compat#7 changed iterator() to iterator and it conflicts with the IteratorCloseOps.iterator field. Renaming it to fix it for 2.13.

@@ -75,10 +76,12 @@ trait DeltaLogging
} else {
Map.empty[TagDefinition, String]
}

val finalTags = mutable.Map[TagDefinition, String](TAG_OP_TYPE -> opType)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually create the map as immutable.Map ++ got removed in Scala 2.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant